#!/usr/bin/env ruby

class Application
  
  attr_accessor :path, :info
  
  def initialize(path = nil)
    if path.to_s != ''
      @path = path.to_s
    else
      @path = "/home/vkorzh75/JDeveloper/mywork/CS/**/trunk"
    end
  end

  def isApp?
    info != nil and info.size > 0
  end

  def info
    Hash[Dir[path+"/**/composite.xml"].collect{|a| c=Composite.new(a);[c.name,c]}]
  end

  def composite(name)
    info[name]
  end
  
  def to_s
    info.to_s
  end
end